<template>
	<view class="groupHome">
		<view class="background"></view>
		<view class="content">
			<view class="avatar">
				<!-- <image class="image" :src="data.icon"></image> -->
				<u-avatar class="image" :src="data.icon" size="400"></u-avatar>
			</view>
			<view class="name">{{data.name}}</view>
			<!-- <view class="nickname">昵称：很好搭档</view> -->
			<view class="desc">{{data.intro}}</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			data: {},
			icon: "icon"
		};
	},
	onLoad(options) {
		let dstId = parseInt(options.dstId)
		this.getCommunityInfo(dstId)
	},
	methods: {
		goBack() {
			this.$u.route({type: 'back'})
		},
		async getCommunityInfo(dstId) {
			let res = await this.$u.api.communityInfo({dstId: dstId})
			if (res != '') {
				this.data = res.data
				uni.setNavigationBarTitle({
					title: this.data.name
				})
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.groupHome {
	.background {
		position: absolute;
		z-index: -1;
		width: 100%;
		height: 100%;
	}
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		.avatar {
			margin-top: 60rpx;
			position: relative;
			z-index: 1;
			.image {
				border: 6rpx solid #ffffff;
				border-radius: 48rpx;
			}
			.icon {
				position: absolute;
				bottom: 20rpx;
				right: 20rpx;
				width: 64rpx;
				height: 64rpx;
				border-radius: 56rpx;
				display: flex;
				justify-content: center;
				align-items: center;
			}
			.man {
				background: #2B85E4;
			}
			.woman {
				background: #ff5d5b;
			}
		}

		.name {
			margin-top: 45rpx;
			font-size: 52rpx;
			color: #272832;
		}

		.nickname {
			font-size: 28rpx;
			color: #272832;
		}

		.desc {
			padding: 40rpx;
			line-height: 48rpx;
			margin-top: 40rpx;
			font-size: 28rpx;
			color: #272832;
		}
	}
}
</style>